package com.attendance.www.hr.service;

import java.util.Date;
import java.util.List;

import com.attendance.www.hr.beans.ApprovalRecordBean;
import com.attendance.www.hr.beans.RequestApprovalBean;
import com.attendance.www.hr.beans.RequestApprovalPageBean;
import com.attendance.www.hr.beans.RequestApprovalParamBean;
import com.attendance.www.hr.beans.RequestApprovalSaveBean;
import com.attendance.www.hr.beans.RequestBean;
import com.attendance.www.hr.beans.RetroactiveApprovalBean;
import com.attendance.www.hr.beans.RetroactiveApprovalPageBean;
import com.attendance.www.hr.beans.RetroactiveApprovalParamBean;
import com.attendance.www.hr.entitys.Request;
import com.attendance.www.hr.entitys.Role;

public interface IApprovalService {
	
	/**
	 * 获得申请列表（审批者）
	 */
	public RequestApprovalPageBean getRequestList(RequestApprovalParamBean paramBean,Integer employeeId);
	
	/**
	 * 获得一条申请信息（审批者）
	 */
	public RequestApprovalBean getRequestApprovalById(Integer requestId);
	
	/**
	 * 批量审批
	 */
	public void saveApprovalRequestList(RequestApprovalSaveBean requestApprovalSaveBean,Integer employeeId,boolean isHr);
	
	/**
	 * 获取补签请求列表
	 */
	public RetroactiveApprovalPageBean getRetroactiveApprovalList(RetroactiveApprovalParamBean paramBean,Integer employeeId);
	
	/**
	 * 补签审批操作
	 * @param retroactiveApprovalBean
	 * @return
	 */
	public boolean saveRetroactiveApproval(RetroactiveApprovalBean retroactiveApprovalBean,Integer employeeId);
	/**
	 * 获取补签结果
	 * @param approvalRecordId
	 * @return
	 */
	public List<ApprovalRecordBean> getApprovalRecordById(Integer retroactiveId);
	
	/**
	 * 获取多条补签结果
	 * @param attendanceId
	 * @return
	 */
	public List<ApprovalRecordBean> getApprovalRecordByAttendanceId(Integer attendanceId);
	
	/**
	 * 查询某人申请的审批信息--张鑫
	 * @param retroactiveId
	 * @return
	 */
	public List<ApprovalRecordBean> getApprovalRecordInfoById(String requestId);
	
	/**
	 * 计算请假时长（小时，两位小数）--张鑫
	 * @param requestBean
	 * @return
	 */
	public Integer getRequestMinutes(RequestBean requestBean);
	
	/**
	 * 计算早上加班时长（分钟）--张鑫
	 * @param requestBean
	 * @return Integer
	 */
	public Integer getMorningMinutes(RequestBean requestBean);
	
	/**
	 * 重新计算考勤状态 
	 */
	public void resetAttendance(Date startDate,Date endDate, List<Integer> employeeIdList);

	public RetroactiveApprovalPageBean getRetroactiveApprovalListByRole(RetroactiveApprovalParamBean paramBean,
			Integer employeeId);

	public RequestApprovalPageBean getRequestListByRoleId(RequestApprovalParamBean paramBean, Integer employeeId);
	
	public String[] getActAttendance(Date curDate,Integer employeeId);
	
	/**
	 * 邮件提醒
	 * @param employeeId 接收者id
	 * @param textPart 正文
	 * @param requestId 申请(或补签)id
	 * @param requestType 申请类型	99是补签，88是工资申请
	 * 忘记密码 requestId==null, requestType==null
	 */
	public void sendEmail(Integer employeeId, String textPart,Integer requestId, Integer requestType);
	
	/**
	 * 驳回时发送邮件
	 * @param employeeId
	 * @param textPart
	 */
	public void sendEmailByReject(Integer employeeId, String textPart,String description);
	
	/**
	 * 通过审批人的岗位，取下一级别审批人的岗位
	 * 找不到合适的岗位时，返回null
	 * @param approvalRole
	 * @param nextApprovalRoleLevel
	 * @param lowestApprovalRoleLevel
	 * @return
	 */
	public Role getNextApprovalRoleId(Role approvalRole, Integer nextApprovalRoleLevel,Integer lowestApprovalRoleLevel);
	
	/**
	 * 判断，然后插入任务表数据
	 * @param taskDate
	 * @param employeeId
	 */
	public void insertTaskByParam(Date taskDate, Integer employeeId);
	
	/**
	 * 审批通过后，更新相关数据
	 * @param request
	 */
	public void updateAfterApproval(Request request);
	
	/**
	 * 删除一般申请的邮件链接key
	 * @param kindsRequestId
	 */
	public void deleteLinkAdd(Integer requestId);
}
